<?php


class SearchAction extends Action {
	public function search(){
		$cont=M('Content');
		import('ORG.Util.Page');
		$name=$_GET['name'];
		$sea['cotitle']= array("like","%{$name}%");
		$count      = $cont->where($sea)->count();
		$Page       = new Page($count,30);
		
		$Page->setConfig('theme','<span class="li_fist">%upPage%</span> %linkPage% <span class="li_last">%downPage%</span>');
		$Page->setConfig('prev','<');
		$Page->setConfig('next','>');
		
		$show       = $Page->show();
		$list = $cont->where($sea)->order('coid desc')->limit($Page->firstRow.','.$Page->listRows)->select();
		$this->assign('list',$list);
		$this->assign('page',$show);
		//导航栏
		$nav = new PublicAction();
		$nav->base();
		//相关阅读
		$nav->reading();
		$this->display();
	}
	
}	